package thread;

import java.io.InputStream;
import java.util.Scanner;

/**
 * @Author: Miyako
 * @Date: 2024-07-19-18:03
 * @Description:
 */
public class ThreadForClock {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("输入倒计时>");
       for (int i= sc.nextInt();i>0;i--) {
           try {
               System.out.println("还有" + i + "秒");
               Thread.sleep(1000);
           } catch (InterruptedException e) {
               System.out.println("被吵醒了");
           }
       }

        System.out.println("闹钟响了");
    }
}
